package {
	import flash.display.Sprite;
	import flare.util.Colors;

	[SWF(width="900", height="800", backgroundColor="#ffffff", frameRate="30")]
	public class treeclimber extends Sprite
	{
		private var data:DataManager;
		private var controls:TreeMapControls;
		private var canvas:Canvas;
		private var sentence:Sentence;
		
		private function dataLoaded():void
		{		
			sentence = new Sentence(Shelf.SHELF_X, Shelf.SHELF_Y + Shelf.SHELF_HEIGHT*1.2, Shelf.SHELF_WIDTH, Shelf.SHELF_HEIGHT/2, 13, 13);
			sentence.fillColor = Colors.rgba(255, 255, 255, 255);
			sentence.lineColor = Colors.rgba(0, 0, 0, 255);
			sentence.lineWidth = 2.0;
			this.addChild(sentence);
			
			canvas = new Canvas(data, Shelf.SHELF_X, Shelf.SHELF_Y + Shelf.SHELF_HEIGHT + sentence.h + 2*10, Shelf.SHELF_WIDTH, Canvas.DEFAULT_HEIGHT, sentence);
			this.addChild(canvas);
			
			controls = new TreeMapControls(data);
			this.addChild(controls);
			
			canvas.controller = controls;
			controls.setCanvas(canvas);
		}
		
		public function treeclimber()
		{
			data = new DataManager(this, this.dataLoaded);
		}
		
	}
}
